import React from 'react'
import './IndexGoods.css'
class IndexGoods extends React.Component {
    constructor() {
        super()
        this.state = {
            //构造器里面的是私有状态，不提倡使用props赋值
        }
    }

    render() {
        let {data} = this.props
        return (
            <div className='indexGoods'>
                <div>
                    <img src={data.img} alt=""/>
                </div>
                <div>
                    <span>名称：{data.name}</span>
                    <span>销售数量：{data.num}</span>
                </div>
            </div>
        )
    }

    componentDidMount() {
    }
}

export default IndexGoods